//用户接口，操作数据库

package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Menu;
import com.example.demo.entity.RoleMenuPermissionDto;
import com.example.demo.entity.User;
import com.example.demo.entity.VO.Announcement;
import com.example.demo.entity.param.AnnouncementParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    User selectUserByLogin(User user);

    Long selectUserByregister(User user);

    User selectUserByUsername(String username);

    Integer getUserRole(Long userId);

    Integer getUserRoleId(Long userId);

    List<RoleMenuPermissionDto> getMenuRoleByRoleId(Integer roleId);

    List<RoleMenuPermissionDto> getAllMenu();

    void updateRoleMenu(Integer roleId,String path);

    void deleteMenu(Integer roleId);

    User selectUserById(Long userId);

    void updateUserInfo(User user);

    List<Announcement> getAnnouncementList(AnnouncementParam param);

    List<Menu> getTotalMenu();

    void addMenu(List<Menu> menus);

    List<Menu> getMenuList(Integer role);

    User selectUser(User loginInfo);

    Integer checkUserIsExist(String username);

    void register(User user);

    User checkForget(User user);

    List<User> getUserList(Integer type);

    void addUser(User user);

    void setRoleById(Long userId);

    void batchInsert(List<User> userList);

    void addRole(Long userId, Integer roleId);

    void batchInsertRole(List<User> userList);

    void batchDelete(@Param("list") List<Long> userlist);


//
//    @Delete("DELETE FROM user WHERE id = #{id}")
//    int deleteUserById(Long id);

}
